home *** CD-ROM | disk | FTP | other *** search
- :: HARRY.BTM v1.2 - Dedicated to Harry Lee, wherever he be.
- :: Poll/freq/send batch routine for BinkleyTerm mail systems.
- :: 4dos 5.+ req'd. Freeware by Bill Whitehouse.
- @echo off
- setlocal
- :: your default zone
- set z=1
- ::... & its outbound
- set ob=f:\out
- :: no last backslash
- ::-=-=- end.cfg -=-=-
-
- iff islabel %1 then
- gosub %1
- else
- text
- Harry POLL [z:]nnn/nnn [c|d|f|h]
- Harry FREQ [z:]nnn/nnn filename [c|d|f|h]
- Harry SEND [z:]nnn/nnn [#d:\path\]filename [c|d|f|h]
- endtext
- quit 4
- endiff
- ::: attach flavor: crash, direct, normal, hold
- for %a in (c d f h) if %@word[-0,%3 %4]=%a set cf=%a
-
- ::: addressing
- ::: optional userlist lookup syntax: /u"firstname lastname"
- :: set ul=c:\bink\fidouser.lst
- ::: note: Chris Dunford's fgrep v1.83 is significantly faster than ffind
- :: iff %@instr[0,2,%2]=/u then
- :: ffind /km/t%@word[",0,/u"%2"] %ul|input %%h
- :: fgrep -i0,25 -j -x -s -1 %@word[",0,%2] %ul|input %%h
- :: set h=%@word[-0,%h]
- :: endiff
-
- if "%h"="" set h=%2
- iff %@numeric[%@word[":/",0,%h]%@word[":/",1,%h]%@word[":/",2,%h]]=0 then
- echo your addressing is wrong.
- quit 2
- endiff
-
- iff %@words[":/",%h] le 2 then
- set har=%h
- elseiff %z=%@word[":",0,%h] then
- set har=%@word[":/",1,%h]/%@word[":/",2,%h]
- else
- set add=%@word[":",0,%h]
- set zo=change
- gosub zone
- set zo=%@instr[%@len[%hex],3,000%hex]
- set hex=
- set har=%@word[":/",1,%h]/%@word[":/",2,%h]
- iff not isdir %ob.%zo then
- cls
- inkey /c/x/w20/k"yn" Create (%ob.%zo) Zone %@word[":",0,%h]? [y/n] %%nz
- if %nz=n .or. "%nz"="" quit 1
- md %ob.%zo
- endiff
- set ob=%ob.%zo
- endiff
-
- do 2
- set add=%@word[":/",%@if["%net"="",0,1],%har]
- :zone
- do until %add = 0
- set hex=%@instr[%@word[0,%@eval[%add %% 16]],1,0123456789abcdef]%hex
- set add=%@int[%@eval[%add/16]]
- enddo
- if %zo=change return
- if "%net"="" (set net=%@instr[%@len[%hex],4,0000%hex]%+set hex=)
- enddo
- set add=%net%%@instr[%@len[%hex],4,0000%hex]
-
- ::: change flavor ?
- if "%cf"="" set cf=f
- set out=%ob\%add
- for %a in (c d f h) if %out.%alo ne %out.%cf%lo .and. exist %out.%alo gosub cf
-
- :::-----------
- if "%req" ne "" echo %req>>%out.req
- iff "%1"="send" .or. not exist %out.%cf%lo then
- %cmd>%@if[%@filesize[%out.%cf%lo] gt 2,>,]%out.%cf%lo
- endiff
- quit 0
- :::-----------
-
- :poll
- set cmd=echo.
- return
-
- :freq
- set req=%3
- set cmd=echo.
- return
-
- :send
- iff exist %@word["#",0,%3] then
- set cmd=echo %3
- else
- echo %@word["#",0,%3] does not exist. aborting.
- quit 3
- endiff
- return
-
- :cf
- set pnd=%@word[%@index[cdfh,%a],crash,direct,normal,hold]
- echo.
- inkey /w20/k"yn" Prepend existing [-%pnd-] mail to this attach? [y/n] %%pp
- if "%pp"="" .or. "%pp"="n" return
- iff not exist %out.%cf%lo .or. %@filesize[%out.%cf%lo] le 2 then
- move %out.%alo %out.%cf%lo/q/v
- else
- copy %out.%cf%lo+%out.%alo %out.%cf%lo/q/v/b
- del %out.%alo/q
- endiff
- return
-
- :: adapted from: HEX2DEC by Barry Block (2:280/901@fidonet)
- :: 24 Jan 96 22:49:52
- :: conference: 4dos
- :: DEC2HEX by Boian Bonev (2:350/32@fidonet)
- :: 02 Feb 96 02:06:42
- :: conference: 4dos
- --- msgedsq 2.1
- * Origin: There's no one as smart as all of us. (1:323/109)
-